﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmForumIcon.aspx.cs" Inherits="WCrawler.frmForumIcon" %>
<%@ Register Src="~/Controls/ucForum.ascx" TagName="ucForum" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" language="javascript">
    function changeCheckState() {
        try {
            var frm = document.forms[0];
            var i = 0;
            for (i = 0; i < frm.length; i++) {
                if (frm.elements[i].id.indexOf('chkCheckItem') != -1) {
                    if (document.getElementById(frm.elements[i].id) != null) {
                        if (frm.elements[i].checked == false) {
                            frm.elements[i].checked = true;
                        } else {
                            frm.elements[i].checked = false;
                        }
                    }
                }
            }
        } catch (err) { }
    }
    </script>
    <div>
    <asp:PlaceHolder runat="server" ID="Body">
        <uc1:ucForum id="ucForumControl" runat="server" OnBubbleIndexChanged="ucForumControlSelectedIndexChanged"/>
    </asp:PlaceHolder>
</div>
<div>
<asp:UpdatePanel ID="PostForumUpdatePanel" runat="server">
    <ContentTemplate>
        <div>
        <asp:Label ID="Label1" runat="server" Text="Add Icon"></asp:Label>
        <asp:TextBox ID="txtIconNumber" runat="server" Width="78px"></asp:TextBox>
            <asp:DropDownList ID="dropDownListHost" runat="server" AutoPostBack="True" 
                DataSourceID="HostLinqDataSource" DataTextField="HostName" 
                DataValueField="HostId">
            </asp:DropDownList>
        <asp:Button ID="btnAddIcon" runat="server" Text="Add Icon" 
                onclick="btnAddIcon_Click" />
        </div>
        <asp:GridView ID="gridViewForumHostIcon" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" DataKeyNames="ForumId,HostId" 
            DataSourceID="ForumHostLinqDataSource" CellPadding="4" 
            ForeColor="#333333" GridLines="Both">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:TemplateField HeaderText = "Host" SortExpression="Host.HostName">
                    <ItemTemplate>
                        <asp:Label ID="lblHost" runat="server" Text='<%#Eval("Host.HostName") %>'> </asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="IconNumber" HeaderText="Icon" 
                    SortExpression="IconNumber" />
            </Columns>
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <SortedAscendingCellStyle BackColor="#FDF5AC" />
            <SortedAscendingHeaderStyle BackColor="#4D0000" />
            <SortedDescendingCellStyle BackColor="#FCF6C0" />
            <SortedDescendingHeaderStyle BackColor="#820000" />
        </asp:GridView>
        
        <asp:LinqDataSource ID="ForumHostLinqDataSource" runat="server" 
            ContextTypeName="WCrawlerLib.LinqDataClassesDataContext" EnableDelete="True" 
            EnableInsert="True" EnableUpdate="True" EntityTypeName="" 
            TableName="ForumHosts" 
            onselecting="ForumHostIconLinqDataSource_Selecting">
        </asp:LinqDataSource>
        
        <asp:LinqDataSource ID="HostLinqDataSource" runat="server" 
            ContextTypeName="WCrawlerLib.LinqDataClassesDataContext" EntityTypeName="" 
            TableName="Hosts">
        </asp:LinqDataSource>
        
    </ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
